package jp.co.ufp.aidl;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

public class CalcService extends Service {

    private final AidlCalcService.Stub aidlCalcService = new AidlCalcService.Stub() {

	@Override
	public int add(int a, int b) throws RemoteException {
	    int r = a + b;
	    return r;
	}
    };

    @Override
    public IBinder onBind(Intent intent) {

	if (AidlCalcService.class.getName().equals(intent.getAction())) {
	    return aidlCalcService;
	}

	return null;
    }

}
